const dbpool=require("../config/dbpoolconfig")

const userController={
    getUser(request,response){//request 请求对象  response-响应对象

        let username=request.query.username1 || request.body.username1 ;
        let pwd=request.query.pwd || request.body.pwd


        dbpool.connect("select * from t_user where username=? and pwd=?",

            [username,pwd],
            (err,data)=>{
                if(!err){
                    if(data.length>0){                       
                        response.redirect("sucess.html");
                    }else{
                        response.redirect("index3.html");
                    }
                }
            }


        )




    },




}

module.exports=userController;